package com.xit.hitmouse.ui;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Window;
import android.widget.TextView;

//import com.example.hitmouse.R;
import com.xit.hitmouse.R;
import com.xit.hitmouse.controller.Controller;

public class GameOver extends Activity{
		Controller controller;
		TextView scoreView;
		TextView height;
	 protected void onCreate(Bundle savedInstanceState) {
		 	
		 controller = new Controller(this);

			super.onCreate(savedInstanceState);

			requestWindowFeature(Window.FEATURE_NO_TITLE);
	        setContentView(R.layout.game_over);

	        Intent intent = getIntent();
	        String name = intent.getStringExtra("name");
			//获取分数
	        String score = intent.getStringExtra("score");
	        scoreView = (TextView) findViewById(R.id.score_text);
	        height =(TextView) findViewById(R.id.highestScore_text);
	        scoreView.setText(score);
	       // controller.saveScore("score", Integer.parseInt(score));
	        String[] current = new String[2];
	       // current[0]  = controller.searchScore()[0];
//1	        current[1]  = controller.searchScore()[1];
//1	        if(Integer.parseInt(current[1])<Integer.parseInt(score))
	        controller.saveScore("score", Integer.parseInt(score));
//1	        height.setText(current[1]);
		 height.setText(score.toString());
	        }

	
}
